#!/usr/bin/env python3 
# -*- coding: UTF-8 -*-

'''
页面测试的基类
by lina
'''
import time
from src.util import driver
from src.util import log
from src.util import screenshot
from src.util import constants

class BasePage:
	'''
	执行类中的每个方法 setUp与tearDown都会执行
	'''

	def __init__(self):
		self.driver = constants.get_value('my_driver')
		self.driver.maximize_window()

		self.mlog = log.Log()
		self.mscreenshot = screenshot.Screenshot()



	"""
	延时函数
	by lina
	"""
	def  delay_time(self):
		time.sleep(1)

	"""
	进入最新的页面
	by lina
	"""
	def to_last_window(self):
		current_window=self.driver.current_window_handle 
		handles = self.driver.window_handles
		self.driver.switch_to.window(handles[-1])




